1. Returning only the code

midway.route({
 id: 'message',
 label: 'hello message',
 path: '/message',
 handler: function(req, reply) {
   reply().code(400);
 }
})

2. Using RespondWithFile without handler

midway.route({
  path: '/api/customer/getId',
  label: 'Get Customer Id',
  method: 'GET',
 }).respondWithFile();

3. Returning static mocked data with a response code

midway.route({
  id: 'message',
  label: 'hello message',
  path: '/message',
 
  handler: function(req, reply) {
    midway.util.respondWithFile(this, reply, {code: 400});
  }
})